package com.example.demo.struct.proxy.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * @Desc:
 * @Author zzz
 * @Date 2021/2/24
 * @Version V1.0
 */
public class DynamicProxyTest {

    public static void main(String[] args) {
        Http axios = new Axios();
        InvocationHandler invocationHandler = new AxiosInvocationHandler(axios);
        Http proxyInstance = (Http) Proxy.newProxyInstance(DynamicProxyTest.class.getClassLoader(), new Class[]{Http.class}, invocationHandler);
        proxyInstance.request();
    }

}
